/* This module defines functions that allows the OS to retrieve the entry point of a program from its name */

#ifndef USER_PROGRAMS_H
#define USER_PROGRAMS_H

#include "types.h"
#include "string.h"
#include "dynamic_memory.h"

/* include (or define) the user programs signature here */
#include "fibonacci.h"
#include "increment.h"
#include "scroller.h"
#include "shell.h"
#include "supervision.h"
#include "oom.h"
#include "ring.h"
#include "ring_node.h"
#include "eat.h"
#include "init.h"

/* count of the number of UP in the system (don't forget to update) */
#define COUNT_UP 14

/* represents a user program in the system */
typedef struct{
  uint32_t entry_point;
  char* name;
  char* help;
}user_program;

/* function declaration */

/* returns the id of the UP called program_name and its entry point*/
int32_t get_program_information(const char* program_name,uint32_t* entry_point);

/* copy the program name of the program having program_id as id in a dynamically allocated on owner's behalf buffer. Returns NULL if the memory is full. */
char* get_program_name(int32_t program_id, int32_t owner);

/* copy the program's help of the program having program_id as id in a dynamically allocated on owner's behalf buffer. Returns NULL if the memory is full. */
char* get_program_help(const char* program_name, int32_t owner);

#endif
